package com.lse_api.config.multipledatasources;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 当前已选择的数据源
 *
 * @author 祁雪
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        System.out.println("数据源为" + DataSourceContextHolder.getDB());
        return DataSourceContextHolder.getDB();
    }

}
